<template>
  <el-select   v-model="formData[formData.valueName]"
               :disabled="formStatus === 'info'"
              :clearable="formData.clearable"
              :filterable="formData.filterable"
              :placeholder="formData.placeholder">
    <el-option
        v-for="item in options"
        :key="item.value"
        :label="item.label"
        :value="item.value"
    />
  </el-select>
</template>

<script setup name="selection">
import {reactive, ref, watch} from "vue";

const options = ref([])
const props = defineProps({
  formData: {
    type: Object,
    default: () => {},
    required: true
  },
  formStatus: {
    type: String,
    default: 'edit'
  }
})
options.value = JSON.parse(JSON.stringify(props.formData.customizeData))
watch(props,(newProps, oldProps) => {
  console.log(1231)
  options.value = JSON.parse(JSON.stringify(newProps.formData.customizeData))
});
</script>

<style scoped lang="scss">

</style>
